#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <assert.h>

char* my_strncpy(char* dest, const char* src, int n)
{
	char* ret = dest;
	assert(dest && src);
	int count = 0;

	while (*dest++ = *src++)
	{
		count++;
		if (count == n)
			break;
	}
	return ret;
}


int main()
{
		char arr1[8] = { 0 };
		char arr2[] = "hello";
		printf("%s", my_strncpy(arr1, arr2,2));
		return 0;
}